// worker.js
const { parentPort } = require('worker_threads');

// 从主线程接收消息
parentPort.on('message', (message) => {
  console.log('Received from main:', message);

  // 回复主线程
  message.port.postMessage('Hello from worker!');
});
